home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 223_01 / strrchr.c < prev    next >
Text File  |  1980-01-01  |  512b  |  17 lines

  1. /*
  2. ** strrchr(s,c) - Search s for rightmost occurrance of c.
  3. ** s      = Pointer to string to be searched.
  4. ** c      = Character to search for.
  5. ** Returns pointer to rightmost c or NULL.
  6. */
  7.   static char *ptr;
  8.  
  9. strrchr(s, c) char *s, c; {
  10.   ptr = 0;
  11.   while(*s) {
  12.     if(*s==c) ptr = s;
  13.     ++s;
  14.     }
  15.   return (ptr);
  16.   }
  17.